/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package pkl53.component;

import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
import java.io.Serializable;
import javax.swing.JFormattedTextField;
import javax.swing.JPanel;

/**
 *
 * @author User
 */
public class TextField extends JFormattedTextField implements Serializable{
    private JPanel panel =null ;
    
    
    public TextField(){
        setPanel(panel);
        addFocusListener(new FocusAdapter() {
            @Override
            public void focusGained(FocusEvent evt){
                getPanel().scrollRectToVisible(evt.getComponent().getBounds());
                repaint();
            }
        });
        
        
    }

    /**
     * @return the panel
     */
    public JPanel getPanel() {
        return panel;
    }

    /**
     * @param panel the panel to set
     */
    public void setPanel(JPanel panel) {
        this.panel = panel;
    }
    
}
